<?php


abstract class Control {
	public $name;
	public function __construct($name=null){
		$this->name = $name==null ? 'x'.ID::Random()->AsHex() : $name;
	}

	public abstract function Render();

	public $mode = UIMode::Edit;
	public function WithMode($value){ $this->mode = $value; return $this;}


	public function __toString(){
		ob_start();
		$this->Render();
		$r = ob_get_contents();
		ob_end_clean();
		return $r;
	}

	public static function Make(){ $a = func_get_args(); $class = get_called_class(); return new $class($a); }
	public static function GetClassName(){ return get_called_class(); }
}



?>